var webpack = require('webpack');

module.exports = {
    // devtool: 'eval-source-map',
    devtool: false,
    entry: {
        "component-comment": __dirname + "/src/assets/comment/component/index.js"
    },
    output: {
        // path: __dirname + "/src/assets/comment",
        path: __dirname + "/dist/component",
        filename: "[name].js"
    },

    module: {
        rules: [{
            test: /\.json$/,
            loader: "json-loader"
        },
            {
                test: /\.js$/,
                exclude: /node_modules/,
                loader: 'babel-loader', //在webpack的module部分的loaders里进行配置即可
                /*query: {
                    presets: ['es2015']
                }*/
                query: {
                    presets: [
                        ['es2015', {
                            'modules': false //babel不编译es6的模块加载，让webpack支持Tree-shaking
                        }]
                    ]
                }
            },
        ]
    },

}